/**
 * Created by Delicate on 2018/1/3.
 */
import React from 'react';
import {
    View,
    Share
} from 'react-native';

import NavBar from '../../components/NavBarView'
import ServerWeb from '../../components/ServerWebView'
import Constants from '../../config/Constants'

class Views extends React.Component {

    share() {
        Share.share({
            message: (Constants.DEV_MODE ? Constants.DEV_BASE_URL : Constants.BASE_URL) + '/web/about'
        })
            .then(()=>{})
            .catch((error) => this.setState({result: 'error: ' + error.message}));
    }

    render() {
        return (
            <View style={base.baseOuter}>
                <NavBar
                    rightEvent={()=>this.share()}
                    rightIcon={require('../../sources/icon_about_share.png')}
                    host={this}
                    title={Constants.APP_NAME}/>
                <ServerWeb url="/web/about"/>
            </View>
        )
    }
}

//路由
const AboutMai = {
    screen: Views,
    navigationOptions: {
        header: null,
    },
    name: 'AboutMai',
    sign: false
};

export default AboutMai;